﻿using System;
using Game1942.Library.Background;
using Game1942.Library.FlightPlans;

namespace Game1942.Library
{
    public abstract class ComputerElement : LivingElement, ILive
    {
        protected TurnManager manageTurn;
        protected FlightPlan flightPlan;
        protected int score;

        public abstract void Live();
        

        public override void Destroy()
        {
            position.Deallocate();  // If it is on the map, get rid of it
            Alive = false;
        }
        public void Move()
        {
            if ( !position.MoveTo(flightPlan.GetNext()))
            {
                Destroy();
            }
        }

        public override void SetPosition(Point aPosition)
        {
            position.Value = aPosition;
            flightPlan.ActualPosition = aPosition;
        }

        public int Score
        {
            get { return score; }
        }
    }
}
